import request from "/@/utils/request"

// 查询
export function fetchList(query) {
  return request({
    url: '/em/deviceonlineinfo/page',
    method: 'get',
    params: query
  })
}
// 查询设备表格数据
export function fetchaccessDeviceList(query) {
  return request({
    url: '/admin/accessDevice/page',
    method: 'get',
    params: query
  })
}
// 获取巡检区域分类树形数据
export function getTreeList(query) {
  return request({
    url: '/om/ominspectionEquipment/getInspectionList',
    method: 'get',
    params: query
  })
}

// 获取巡检区域分类树形数据
export function getTreeListChild(id) {
  return request({
    url: '/om/ominspectionEquipment/getInspectionChlList/' + id,
    method: 'get'
  })
}
// 获取列表
export function getlistData(query) {
  return request({
    url: '/om/ominspectionEquipment/page',
    method: 'get',
    params: query
  })
}

//批量删除
export function delAllObj(obj) {
  return request({
    url: '/om/ominspectionEquipment/batchDelDevice',
    method: 'post',
    data: obj
  })
}
// 获取巡检区域分类巡检事项
export function getlist(query) {
  return request({
    url: '/om/ominspectionEquipment/queryItems/' + query,
    method: 'get'
  })
}
// 修改巡检区域分类巡检事项
export function setList(obj) {
  return request({
    url: '/om/ominspectionEquipment',
    method: 'put',
    data: obj
  })
}
// 修改巡检区域分类巡检事项
export function addList(obj) {
  return request({
    url: '/om/ominspectionEquipment',
    method: 'post',
    data: obj
  })
}
// 删除巡检区域分类巡检事项
export function delList(obj) {
  return request({
    url: '/om/ominspectionEquipment/deleteOutById',
    method: 'post',
    data:obj
  })
}
// 通过设备查询巡检事项
export  function getChl(obj){
  return request({
    url:'/om/ominspectionEquipment/queryItemsList',
    method:'post',
    data:obj
  })
}
// 同步事项
export  function sytList(obj){
  return request({
    url:'/om/ominspectionEquipment/synchronizationItems',
    method:'post',
    data:obj
  })
}
// 删除大类类巡检事项
export function delLists(obj) {
  return request({
    url: '/om/ominspectionEquipment/deleteInById',
    method: 'post',
    data:obj
  })
}
// 删除小类类类巡检事项
export function delChildLists(obj) {
  return request({
    url: '/om/ominspectionEquipment/deleteInByChildId',
    method: 'post',
    data:obj
  })
}
//设备系统树状结构
export function getTreeType() {
  return request({
    url: '/bm/bamaassetscloumn/fullTreeMenu?lazy=true&level=1',
    method: 'get'
  })
}
export function fetchaccessCategoryList(query) {
  return request({
    url: '/admin/accessCategory/page',
    method: 'get',
    params: query
  })
}
// 条件查询资产类型
export function getDeviceType(obj) {
  return request({
    url: `/bm/bamaassetstype/getAssetsTypeBy`,
    method: 'post',
    data: obj
  })
}

export function getDevtypeById(obj) {
  return request({
    url: `/bm/bamaassetsmodel/getAssetsModelBy`,
    method: 'post',
    data: obj
  })
}
//根据条件查设备
export function fetchaccessProductList(query) {
  return request({
    url: '/admin/accessProduct/page',
    method: 'get',
    params: query
  })
}
